{extend name="../../admin/view/public/admin"}

{block name='content'}
<div class="page-header">
    <span>
        当前位置：<span class="text-primary">用户列表</span>
    </span>
    <span>
        全用户数:  <span class='text-danger'>{$total}</span>
    </span>
</div>
<div class="page-content">

    <form action="" method="get" class="form-horizontal table-search" role="form">
        <div class="page-toolbar">
            <div class="col-md-12 input-group pull-right">
                <input type="text" class="form-control " name="keyword" value="{$_GET['keyword']}" placeholder="可搜索昵称、姓名、手机号关键词查询">
                <span class="input-group-select">
                    <select name="searchtime" class="form-control" style="width:100px;padding:0 5px;" id="searchtime">
                        <option value="">全部时间</option>
                        <option value="create" {if $_GET['searchtime']=='create'}selected{/if}>注册时间</option>
                    </select>
                </span>
                <span class="input-group-btn">{:tpl_form_field_daterange('time', array('starttime'=>date('Y-m-d H:i', $starttime),'endtime'=>date('Y-m-d H:i', $endtime)),true);}</span>
                <span class="input-group-btn">
                    <button class="btn btn-primary" type="submit"> 搜索</button>
                    <!--                    <button type="submit" name="export" value="1" class="btn btn-success" style="margin-left: 20px;">导出</button>-->
                </span>
            </div>
        </div>

    </form>

    {if empty($list)}
    <div class="panel panel-default">
        <div class="panel-body empty-data">未查询到相关数据</div>
    </div>
    {else/}
    <div class="row">
        <div class="col-md-12">
            <table class="table table-responsive">
                <thead>
                <tr>
                    <th style="width:40px">ID</th>
                    <th style="width:120px">用户信息</th>
                    <th style="width:120px">登录账号</th>
                    <th style="width:120px">绑定手机号</th>
                    <th style="width: 120px;">注册时间</th>
                    <th style="width: 100px;text-align:center;">操作</th>
                </tr>
                </thead>
                <tbody>
                {foreach $list as $key=>$row }
                <tr>
                    <td>{$row['id']}</td>
                    <td style="overflow: visible;white-space:normal;">
                        <div rel="pop" style="display: flex" data-content="
                                <span>ID: </span>{$row['id']} </br>
                                <span>账号: </span>{$row['username']}</br>
                                <span>昵称: </span>{$row['nickname']}</br>
                                <span>手机号: </span>{$row['mobile']} </br>
                                <span>性别: </span>{$row['gender'] == 1 ? '男' : ( $row['gender'] == 2 ? '女' : '未知' )} </br>
                                ">

                            <a href="{:tomedia($row['avatar'])}" target="_blank">
                                <img class="img-40" src="{$row['avatar']}" style="border-radius:50%;border:1px solid #efefef;" onerror="this.src='{if $row.gender == 0 || $row.gender == 1}/app/admin/static/images/male.png{else}/app/admin/static/images/female.png{/if}'">
                            </a>

                            <span style="display: flex;flex-direction: column;justify-content: center;align-items: flex-start;padding-left: 5px">
                                <span class="nickname">
                                    {$row['nickname']}<br>
                                </span>
                            </span>

                        </div>
                    </td>
                    <td>
                        {$row['username']}
                    </td>
                    <td>
                        {$row['mobile']}
                    </td>
                    <td>
                        {:date("Y-m-d",$row['createtime'])}
                        <br/>
                        {:date("H:i:s",$row['createtime'])}
                    </td>
                    <td style="text-align:center;">
                        <a class='btn btn-default btn-sm  btn-op btn-operation' href="{:webUrl('web.member/edit', array('id' => $row['id']))}">
                            <span data-toggle="tooltip" data-placement="top" title="" data-original-title="编辑">
                                <i class="icow icow-bianji2"></i>
                            </span>
                        </a>
                    </td>
                </tr>
                {/foreach}
                </tbody>
                <tfoot>
                <tr>
                    <td colspan="6" class="text-right">
                        {$pager | raw}
                    </td>
                </tr>
                </tfoot>
            </table>
        </div>
    </div>
    {/if}
</div>

<script language="javascript">

</script>
{/block}